package com.demo.modalframe3.listener;

import com.demo.modalframe3.utils.AppendTextFrame;

import javax.swing.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class FrameMouseListener extends MouseAdapter {

    @Override
    public void mousePressed(MouseEvent e) {
        JFrame frame = (JFrame)e.getSource();
        if (frame instanceof AppendTextFrame) {
            ((AppendTextFrame)frame).appendText2TextPane(e.paramString());
        }
        super.mousePressed(e);
    }
}
